<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<p class="p"></p>
		<script type="text/javascript">
			var p = document.querySelector(".p");
			var time=5;
			var timer=setInterval(()=>{
				time--;
			p.innerHTML=time;
			if(time==0){
				clearInterval(timer);
				alert("结束")
			}
			},1000);
		</script>
	</body>
</html>
